<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>ArduPilot Hardware Report</title>
<link rel="icon" href="../images/AP_favicon.png">
<script type="text/javascript" src="HardwareReport.js"></script>
<script type="text/javascript" src="../Libraries/DecodeDevID.js"></script>
<script type="text/javascript" src="../Libraries/FileSaver.js"></script>
<script type="text/javascript" src="../Libraries/Array_Math.js"></script>
<script type="text/javascript" src="../Libraries/OpenIn.js"></script>
<script type="text/javascript" src="../Libraries/LoadingOverlay.js"></script>
<script type="text/javascript" src="../Libraries/Param_Helpers.js"></script>
<script type="text/javascript" src="../Libraries/LogHelpers.js"></script>

<script src='../modules/plotly.js/dist/plotly.min.js'></script>

<script src="../modules/build/floating-ui/dist/umd/popper.min.js"></script>
<script src="../modules/build/tippyjs/dist/tippy-bundle.umd.min.js"></script>

</head>
<table style="width:1200px"><tr><td>
  <a href="https://ardupilot.org"><img src="../images/ArduPilot.png"></a>
</td><td>
  <a href="https://github.com/ArduPilot/WebTools"><img src="../images/github-mark.png" style="width:60px"></a>
  <br>
  <a href="https://github.com/ArduPilot/WebTools"><img src="../images/GitHub_Logo.png" style="width:60px"></a>
</td></tr></table>

<style>
  div.plotly-notifier {
    visibility: hidden;
  }
</style>

<h1><a href="" style="color: #000000; text-decoration:none;">ArduPilot Hardware Report</a></h1>

<body onload="initial_load(); reset();">
<input id="fileItem" type="file" accept=".param,.parm,.bin" onchange="load(this)">

<input id="OpenIn" type="button" value="Open In" disabled>

<h3 hidden>Firmware</h3>
<p id="VER"></p>

<h3 hidden>Flight Controller</h3>
<p id="FC"></p>

<h3 hidden>Watchdog</h3>
<p id="WDOG"></p>

<h3 hidden>Internal Errors</h3>
<p id="InternalError"></p>

<h3 hidden>IOMCU</h3>
<p id="IOMCU"></p>

<h3 hidden>Inertial Sensors</h3>
<p id="INS"></p>

<h3 hidden>Compasses</h3>
<p id="COMPASS"></p>

<h3 hidden>Barometers</h3>
<p id="BARO"></p>

<h3 hidden>GPS</h3>
<p id="GPS"></p>

<h3 hidden>Airspeed Sensors</h3>
<p id="ARSPD"></p>

<h3 hidden>DroneCAN devices</h3>
<p id="DroneCAN"></p>

<h3 hidden>Download Parameters</h3>
<div id="ParametersContent" hidden>
  <p>
    <input type="button" value="Save All Parameters" onclick="save_all_parameters();">
    <input type="button" id="SaveChangedParams" value="Save Changed Parameters" title="saves only those parameters that have been changed from their default value" onclick="save_changed_parameters();" hidden>
  </p>
  <h4>Minimal Configuration</h4>
  <p style="width:600px">
    Configuration parameters excluding calibrations, flight modes, etc. You may select certain of these to be included with the check boxes below.
    For sharing and comparing similar vehicle configurations.

    <fieldset style="width:600px" hidden>
      <legend>Basic Configuration Parameters</legend>
      <input type="radio" id="param_base_all" name="param_base" onchange="update_minimal_config()" checked>
      <label for="param_base_all">All</label>
      <input type="radio" id="param_base_changed" name="param_base" onchange="update_minimal_config()" disabled>
      <label for="param_base_changed">Changed from defaults</label><br>
    </fieldset>

    <form id="params" hidden>
      <table>
        <tr>
          <td>
            <fieldset style="width:175px; height:150px">
              <legend>Inertial Sensors</legend>
              <input type="checkbox" id="param_ins_gyro">
              <label for="param_ins_gyro">Gyro</label>
              <br>
              <input type="checkbox" id="param_ins_accel">
              <label for="param_ins_accel">Accel</label>
              <br>
              <input type="checkbox" id="param_ins_use">
              <label for="param_ins_use">Use</label>
              <br>
              <input type="checkbox" id="param_ins_position">
              <label for="param_ins_position">Position</label>
              <br>
            </fieldset>
          </td>
          <td>
            <fieldset style="width:175px; height:150px">
              <legend>Compass</legend>
              <input type="checkbox" id="param_compass_calibration">
              <label for="param_compass_calibration">Calibration</label>
              <br>
              <input type="checkbox" id="param_compass_ordering">
              <label for="param_compass_ordering">Ordering</label>
              <br>
              <input type="checkbox" id="param_compass_id">
              <label for="param_compass_id">IDs</label>
              <br>
              <input type="checkbox" id="param_compass_use">
              <label for="param_compass_use">Use</label>
              <br>
              <input type="checkbox" id="param_declination">
              <label for="param_declination">Declination</label>
              <br>
            </fieldset>
          </td>
          <td>
            <fieldset style="width:175px; height:150px">
              <legend>Barometer</legend>
              <input type="checkbox" id="param_baro_calibration">
              <label for="param_baro_calibration">Calibration</label>
              <br>
              <input type="checkbox" id="param_baro_id">
              <label for="param_baro_id">IDs</label>
              <br>
              <input type="checkbox" id="param_baro_wind_comp">
              <label for="param_baro_wind_comp">Wind compensation</label>
              <br>
            </fieldset>
          </td>
        </tr>
        <tr>
          <td>
            <fieldset style="width:175px; height:150px">
              <legend>Airspeed</legend>
              <input type="checkbox" id="param_airspeed_type">
              <label for="param_airspeed_type">Type</label>
              <br>
              <input type="checkbox" id="param_airspeed_calibration">
              <label for="param_airspeed_calibration">Calibration</label>
              <br>
              <input type="checkbox" id="param_airspeed_use">
              <label for="param_airspeed_use">Use</label>
              <br>
            </fieldset>
          </td>
          <td>
          <fieldset style="width:175px; height:150px">
            <legend>AHRS</legend>
            <input type="checkbox" id="param_ahrs_trim">
            <label for="param_ahrs_trim">Trim</label><br>
            <input type="checkbox" id="param_ahrs_orientation">
            <label for="param_ahrs_orientation">Orientation</label><br>
          </fieldset>
        </td>
        <td>
          <fieldset style="width:175px; height:150px">
            <legend>RC</legend>
            <input type="checkbox" id="param_rc_calibration">
            <label for="param_rc_calibration">Calibration</label>
            <br>
            <input type="checkbox" id="param_rc_reverse">
            <label for="param_rc_reverse">Reversals</label>
            <br>
            <input type="checkbox" id="param_rc_dz">
            <label for="param_rc_dz">Dead zone</label>
            <br>
            <input type="checkbox" id="param_rc_options">
            <label for="param_rc_options">Options</label>
            <br>
            <input type="checkbox" id="param_rc_flightmodes">
            <label for="param_rc_flightmodes">Flight modes</label>
            <br>
          </fieldset>
        </td>
        </tr>
      </table>

      <fieldset style="width:600px">
        <legend>Stream rates</legend>
        <input type="checkbox" id="param_stream_0">
        <label for="param_stream_0">SR 0,</label>

        <input type="checkbox" id="param_stream_1">
        <label for="param_stream_1">SR 1,</label>

        <input type="checkbox" id="param_stream_2">
        <label for="param_stream_2">SR 2,</label>

        <input type="checkbox" id="param_stream_3">
        <label for="param_stream_3">SR 3,</label>

        <input type="checkbox" id="param_stream_4">
        <label for="param_stream_4">SR 4,</label>

        <input type="checkbox" id="param_stream_5">
        <label for="param_stream_5">SR 5,</label>

        <input type="checkbox" id="param_stream_6">
        <label for="param_stream_6">SR 6</label>
      </fieldset>
    </form>

    <br>
    <input type="button" id="SaveMinimalParams" value="Save Minimal Parameters" onclick="save_minimal_parameters();" hidden>
  </p>
  <h4>Parameters Changed During Logging</h4>
  <p id="ParameterChanges"></p>
</div>

<h3 hidden>Download Waypoints</h3>
<p id="WAYPOINTS"></p>

<h3 hidden>Download Files</h3>
<p id="FILES"></p>

<div hidden>
  <h3>Position offsets</h3>
  <div id="POS_OFFSETS" style="width:800px;height:800px"></div>
</div>

<div hidden>
  <h3>Temperature</h3>
  <div id="Temperature" style="width:800px;height:400px"></div>
</div>

<div hidden>
  <h3>Board Voltage</h3>
  <div id="Board_Voltage" style="width:800px;height:400px"></div>
</div>

<h3 id="CPU" hidden>CPU</h3>
<div hidden>
  <h4>Load</h4>
  <div id="performance_load" style="width:800px;height:400px"></div>
</div>

<div hidden>
  <h4>Free memory</h4>
  <div id="performance_mem" style="width:800px;height:400px"></div>
</div>

<div hidden>
  <h4>Loop times</h4>
  <div id="performance_time" style="width:800px;height:400px"></div>
</div>

<h3 hidden>Data Rates</h3>
<p id="DataRates"></p>

<h3 id="Stack" hidden>Stack</h3>
<div hidden>
  <h4>Free memory</h4>
  <div id="stack_mem" style="width:800px;height:400px"></div>
</div>

<div hidden>
  <h4>Memory usage</h4>
  <div id="stack_pct" style="width:800px;height:400px"></div>
</div>

<h3 id="log_stats_header" hidden>Log stats</h3>
<div hidden>
  <h4>Dropped messages</h4>
  <div id="log_dropped" style="width:800px;height:400px"></div>
</div>

<div hidden>
  <h4>Free Buffer Space</h4>
  <div id="log_buffer" style="width:800px;height:400px"></div>
</div>

<div hidden>
  <h4>Log Composition</h4>
  <p id="LOGSTATS"></p>
  <div id="log_stats" style="width:800px;height:800px"></div>
</div>

<div hidden>
  <h3>Clock drift</h3>
  <div id="clock_drift" style="width:800px;height:400px"></div>
</div>

<script>

  window.onerror = function(msg, url, linenumber) {
      alert('Sorry, something went wrong.\n\n' + 
            'Please try a hard reload of this page to clear its cache.\n\n' +
            'If the error persists open an issue on the GitHub repo.\n' +
            'Include a copy of the log and the following error message:\n\n' +
            msg + '\n' +
            'URL: '+ url +'\n' +
            'Line Number: '+ linenumber)
      return false
  }
  window.addEventListener('unhandledrejection', function (e) {
    throw new Error(e.reason.stack)
  })

  const open_in_update = setup_open_in("OpenIn", "fileItem", function (data) { loading_call(() => { reset(); load_log(data) }) }, "right")

  init_loading_overlay()

</script>

</body>
</html>
